home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / gui / gtldv374.lha / GadUtil / Docs / AutoDocs / 01.GU_LayoutGadgetsA < prev    next >
Text File  |  1996-05-14  |  33KB  |  784 lines

  1. gadutil.library/GU_LayoutGadgetsA           gadutil.library/GU_LayoutGadgetsA
  2.  
  3.    NAME
  4.     GU_LayoutGadgetsA -- Formats an array of GadTools gadgets.
  5.  
  6.    SYNOPSIS
  7.     gad_info = GU_LayoutGadgetsA(gad_list, gadgets, screen, taglist)
  8.     D0,A0                        A0        A1       A2      A3
  9.  
  10.     APTR GU_LayoutGadgetsA(struct Gadget **, struct LayoutGadget *,
  11.         struct Screen *, struct TagItem *);
  12.  
  13.    FUNCTION
  14.     Creates a laid-out gadget list from a LayoutGadget array, which
  15.     describes each gadget you want to create. Gadgets you create can
  16.     be any of the gadget kinds supported by GadTools, as well as any
  17.     of the extended gadget kinds provided by GadUtil.
  18.     The gadgets created by this routine, can easily be defined so that
  19.     they adjust their sizes and positions to accomodate fonts of any
  20.     size, and also adapt to different locale strings.
  21.     
  22.    INPUTS
  23.     gad_list - a pointer to the gadget list pointer. This will be
  24.            ready to pass to OpenWindowTagList() or AddGList().
  25.  
  26.     gadgets - an array of LayoutGadget structures. Each element in
  27.           the array describes one of the gadgets that you will
  28.           be creating. Each LayoutGadget structure in the array
  29.           should be initialized as follows:
  30.  
  31.           lg_GadgetID - the ID for this gadget. An ID of -1
  32.                 terminates the array.
  33.  
  34.           lg_LayoutTags - tags that describes each gadget to
  35.                   create. These tags is used to calculate
  36.                   positions, sizes and other attributes
  37.                   of the created gadgets.
  38.  
  39.           lg_GadToolsTags - additional tags for GadTools gadgets.
  40.                     This would be the same set of tags that
  41.                     you might pass to CreateGadgetA() if
  42.                     you were using GadTools directly.
  43.  
  44.           lg_Gadget - the pointer to the Gadget structure created
  45.                   for this gadget will be placed here. You
  46.                   should initialize this field to NULL. The
  47.                   gadget structure created should be considered
  48.                   READ ONLY! This field will contain a pointer
  49.                   to a struct BBoxData, if the created gadget
  50.                   kind is a BEVELBOX_KIND or a LABEL_KIND.
  51.  
  52.           Assembly language programmers can use the macro GADGET:
  53.  
  54.             GADGET GadgetID, Gad_LayoutTags, Gad_GadToolsTags
  55.  
  56.     screen - a pointer to the screen that the gadgets will be created
  57.          for. This is required, so that the layuot routines can
  58.          get display info about the screen where the rendering
  59.          will be done. Use LockPubScreen() to use a public screen,
  60.          or OpenScreenTagList(), if you want to use your own screen.
  61.  
  62.     taglist - pointer to an array of tags providing optional extra
  63.           parameters, or NULL.
  64.  
  65.                   These tags can be used here:
  66.  
  67.                     GU_RightExtreme (ULONG *)
  68.                       A pointer to a longword that is used to store the
  69.                       rightmost point that a gadget will exist in.
  70.  
  71.                     GU_LowerExtreme (ULONG *)
  72.                       A pointer to a longword that is used to store the
  73.                       lowermost point that a gadget woll exist in.
  74.  
  75.                     GU_Catalog (struct Catalog *)
  76.                       A pointer to the programs translation catalog. NULL
  77.                       indicates that the program should use the internal
  78.                       strings. You must open the catalog by yourself (use
  79.                       GU_OpenCatalog() or locale/OpenCatalog). The
  80.                       GU_AppStrings tag MUST be used together with this tag.
  81.  
  82.                     GU_DefTextAttr (struct TextAttr *)
  83.                       Specifies the default font to use with all gadgets. Can
  84.                       be overridden with GU_TextAttr tag for each gadget.
  85.  
  86.                     GU_AppStrings (struct AppString *)
  87.                       A pointer to an array of AppString structures. These
  88.                       strutures contains the programs internal strings. This
  89.                       tag must be used together with the GU_Catalog tag.
  90.  
  91.                     GU_BorderLeft (ULONG)
  92.                       Size of the window's left border.
  93.  
  94.                     GU_BorderTop (ULONG)
  95.                       Size of the window's top border.
  96.  
  97.                     GU_NoCreate (BOOL)
  98.                       Don't create any gadgets. Useful to determine if the
  99.                       window will fit on the screen etc.
  100.  
  101.                     GU_MinimumIDCMP (ULONG *)
  102.                       A pointer to a longword that is used to store the
  103.                       minimum required IDCMP flags, so that all gadgets will
  104.                       work. The longword can already be initialized, and any
  105.                       new needed IDCMP flags will be appended to that
  106.                       longword.
  107.  
  108.    TAGS
  109.  
  110.    Tags for the gadgets lg_LayoutTags taglist. The other tags can be found in
  111.    the autodoc to gadtools.library/CreateGadgetA().
  112.  
  113.    GU_GadgetKind (ULONG)
  114.       Can be any of the standard GadTools gadget kinds, or one of the
  115.       extensions provided by GadUtil. Currently extended types are:
  116.  
  117.          IMAGE_KIND
  118.            A gadget that uses an Intuition Image structure for its
  119.            contents. Selected and unselected states can use different
  120.            images. The images are centered automatically.
  121.  
  122.            Extra tags for IMAGE_KIND:
  123.  
  124.               GUIM_Image (struct Image *)
  125.                  Image for the gadget in its unselected state. This is
  126.                  the only required (extra) tag for IMAGE_KIND gadgets.
  127.  
  128.               GUIM_SelectImg (struct Image *)
  129.                  Image for the gadget in its selected state. If this tag
  130.                  is omitted, the selected image will be the same as the
  131.                  unselected, and only the border and the background color
  132.                  will change (depending on the GUIM_BOOPSILook tag).
  133.  
  134.               GUIM_ReadOnly (BOOL)
  135.                  TRUE to create a read-only image gadget.
  136.  
  137.               GUIM_BOOPSILook (BOOL)
  138.                  This tag will allow the programmer to select how the
  139.                  secondary image should be shown, if only one image is
  140.                  used for the gadget. Defaults to TRUE, which means that
  141.                  the background color will change when the user selects
  142.                  the gadget.
  143.  
  144.          DRAWER_KIND
  145.            A "select drawer" image button. This can be used to select
  146.            a path, but is often used to select files.
  147.  
  148.          FILE_KIND
  149.            A "select file" image button. This can be used to allow the
  150.            user to select a file. Most programs uses the DRAWER_KIND
  151.            for both file and path selection.
  152.  
  153.          BEVELBOX_KIND
  154.            A GadTools bevelbox. Use this to avoid the use of absolute
  155.            sizing of bevelboxes. All bevel box kinds from OS3.0 is
  156.            supported, even if the computer only has OS2.0.
  157.  
  158.            The function GU_RefreshBoxes() can be used to redraw all
  159.            bevelboxes.
  160.  
  161.            Extra tags for BEVELBOX_KIND:
  162.  
  163.               GUBB_Recessed (BOOL)
  164.                  Create a recessed ("pushed in") bevel box. Differs from
  165.                  the GadTools tag GTBB_Recessed, in that it works with
  166.                  both TRUE and FALSE as parameter. GadTools creates a
  167.                  recessed box independent from the given value.
  168.  
  169.                  Defaults to FALSE.
  170.  
  171.               GUBB_FrameType (ULONG)
  172.                  Determines what kind of box this function renders. The
  173.                  current available alternatives are:
  174.  
  175.                     BFT_BUTTON - Generates a box like what is used around
  176.                                  a GadTools BUTTON_KIND gadget.
  177.  
  178.                     BFT_RIDGE - Generates a box like what is used around
  179.                                 a GadTools STRING_KIND gadget.
  180.  
  181.                     BFT_DROPBOX - Generates a box suitable for a standard
  182.                                   icon drop box imagery.
  183.  
  184.                     BFT_HORIZBAR - Generates a horizontal shadowed line.
  185.                                    Can also be used to draw a normal line,
  186.                                    using 1 for the line's height.
  187.  
  188.                     BFT_VERTBAR - Generates a vertical shadowed line. Can
  189.                                   also be used to draw a normal line, using
  190.                                   1 for the line's width.
  191.  
  192.                  Defaults to BFT_BUTTON.
  193.  
  194.               GUBB_TextColor (ULONG)
  195.                  Selects which color to print the title text in. Only useful
  196.                  for a bevelbox with a title. Defaults to the color of the
  197.                  TEXTPEN.
  198.  
  199.               GUBB_TextPen (ULONG)
  200.                  Selects which pen to print the title text in. Only
  201.                  useful for a bevelbox with a title. Defaults to TEXTPEN.
  202.                  This tag overrides the GUBB_TextColor tag.
  203.  
  204.               GUBB_Flags (ULONG)
  205.                  Flags for text placement, text shadowing and 3D text:
  206.  
  207.                  Y-pos flags
  208.                  ~~~~~~~~~~~
  209.                     BB_TEXT_ABOVE - Places the bevel box text above the upper
  210.                                     border of the box           ___Example___
  211.  
  212.                     BB_TEXT_IN    - Places the bevel box text at the upper
  213.                                     border of the box           ---Example---
  214.  
  215.                     BB_TEXT_BELOW - Places the bevel box text below the upper
  216.                                     border of the box           ___       ___
  217.                                                                    Example
  218.                  X-pos flags
  219.                  ~~~~~~~~~~~
  220.                     BB_TEXT_CENTER - Places the bevel box text in the middle
  221.                                      of the upper border        ---Example---
  222.  
  223.                     BB_TEXT_LEFT   - Places the bevel box text 8 pixels from
  224.                                      the left edge of the box   -Example-----
  225.  
  226.                     BB_TEXT_RIGHT  - Places the bevel box text 8 pixels from
  227.                                      the right edge of the box  -----Example-
  228.  
  229.                  Combined flags
  230.                  ~~~~~~~~~~~~~~
  231.                     BB_TEXT_ABOVE_CENTER - BB_TEXT_ABOVE + BB_TEXT_CENTER
  232.                     BB_TEXT_ABOVE_LEFT   - BB_TEXT_ABOVE + BB_TEXT_LEFT
  233.                     BB_TEXT_ABOVE_RIGHT  - BB_TEXT_ABOVE + BB_TEXT_RIGHT
  234.  
  235.                     BB_TEXT_IN_CENTER    - BB_TEXT_IN + BB_TEXT_CENTER
  236.                     BB_TEXT_IN_LEFT      - BB_TEXT_IN + BB_TEXT_LEFT
  237.                     BB_TEXT_IN_RIGHT     - BB_TEXT_IN + BB_TEXT_RIGHT
  238.  
  239.                     BB_TEXT_BELOW_CENTER - BB_TEXT_BELOW + BB_TEXT_CENTER
  240.                     BB_TEXT_BELOW_LEFT   - BB_TEXT_BELOW + BB_TEXT_LEFT
  241.                     BB_TEXT_BELOW_RIGHT  - BB_TEXT_BELOW + BB_TEXT_RIGHT
  242.  
  243.                  Default is BB_TEXT_ABOVE|BB_TEXT_CENTER. Combine the x and y
  244.                  position flags by OR:ing them together. Don't combine two X
  245.                  or two Y flags together.
  246.                 
  247.                  Shadow placement flags
  248.                  ~~~~~~~~~~~~~~~~~~~~~~
  249.                     BB_SHADOW_DR - Places the bevel box text shadow one pixel
  250.                                    below and to the right of the text. 
  251.  
  252.                     BB_SHADOW_UR - Places the bevel box text shadow one pixel
  253.                                    above and to the right of the text. 
  254.  
  255.                     BB_SHADOW_DL - Places the bevel box text shadow one pixel
  256.                                    below and to the left of the text. 
  257.  
  258.                     BB_SHADOW_UL - Places the bevel box text shadow one pixel
  259.                                    above and to the left of the text. 
  260.  
  261.                     BB_SUNAT_UL  - Another name for BB_SHADOW_DR
  262.                     BB_SUNAT_DL  - Another name for BB_SHADOW_UR
  263.                     BB_SUNAT_UR  - Another name for BB_SHADOW_DL
  264.                     BB_SUNAT_DR  - Another name for BB_SHADOW_UL
  265.  
  266.                  Default is BB_SHADOW_DR (BB_SUNAT_UL).
  267.  
  268.                     BB_3DTEXT    - This flag can be used in place of the tag
  269.                                    GUBB_3DText, TRUE
  270.  
  271.               GUBB_3DText (BOOL)
  272.                  Enables the shadow on the bevel box text. This tag must be
  273.                  used if GUBB_ShadowColor or GUBB_ShadowPen isn't used.
  274.                  Another way to enable 3D text is to set the flag BB_3DTEXT
  275.                  in the GUBB_Flags tag.
  276.  
  277.               GUBB_ShadowColor (ULONG)
  278.                  Selects which color to print the shadow text in. Only useful
  279.                  for a bevelbox with a title. Defaults to the color of the
  280.                  SHADOWPEN.
  281.  
  282.               GUBB_ShadowPen (ULONG)
  283.                  Selects which pen to print the shadow text in. Only useful
  284.                  for a bevelbox with a title. Defaults to SHADOWPEN.
  285.                  This tag overrides the GUBB_ShadowColor tag.
  286.  
  287.          PROGRESS_KIND
  288.            Gadget used to display a value out of a total. Can be used to
  289.            display the progress of a search, a diskcopy or anything else.
  290.  
  291.            Extra tags for PROGRESS_KIND:
  292.  
  293.               GUPR_FillColor (ULONG)
  294.                  Selects which color to use to paint the current value of
  295.                  the progress requester with. Defaults to the color of the
  296.                  FILLPEN.
  297.  
  298.               GUPR_FillPen (ULONG)
  299.                  Selects which pen to use to paint the current value of
  300.                  the progress requester with. Defaults to the FILLPEN.
  301.                  This tag overrides the GUPR_FillColor tag.
  302.  
  303.               GUPR_BackColor (ULONG)
  304.                  Selects which color to fill the background of the progress
  305.                  requester with. Defaults to the color of the BACKGROUNDPEN.
  306.  
  307.               GUPR_BackPen (ULONG)
  308.                  Selects which pen to fill the background of the progress
  309.                  requester with. Defaults to the BACKGROUNDPEN.
  310.                  This tag overrides the GUPR_BackColor tag.
  311.  
  312.               GUPR_Current (ULONG)
  313.                  The initial current value of the progress requester. The
  314.                  gadget's current value may be changed later by directly
  315.                  modifying the pg_Current field of the ProgressGad structure.
  316.                  Use GU_UpdateProgress to redraw the progress requester with
  317.                  the new value. The pg_Current field must not be larger than
  318.                  4.294.967.295 / the width of the progress gadget. A "normal"
  319.                  width of 410 pixels allows a current value of 10.737.418.
  320.          Defaults to 0.
  321.  
  322.               GUPR_Total (ULONG)
  323.                  The initial total value of the progress requester. The
  324.                  gadget's total value may be changed later by directly
  325.                  modifying the pg_Total field of the ProgressGad structure.
  326.                  Use GU_UpdateProgress() to redraw the progress requester with
  327.                  the new value. The total value can be as large as a longword
  328.                  allows (4.294.967.295), but you can't display a current value
  329.                  larger than 4.294.967.295 / the width of the progress gadget.
  330.          Defaults to 100.
  331.  
  332.          LABEL_KIND
  333.            A text label. Use this to avoid the use of absolute placement
  334.            of text that you print into the window. Supports the most of
  335.            the text placement and shadow flags for the BEVELBOX_KIND.
  336.  
  337.            The function GU_RefreshBoxes() can be used to redraw all
  338.            text created by LABEL_KIND gadgets.
  339.  
  340.            Extra tags for LABEL_KIND:
  341.  
  342.               GULB_TextColor (ULONG)
  343.                  Selects which color to print the text in. Defaults to the
  344.                  color of the TEXTPEN.
  345.  
  346.               GULB_TextPen (ULONG)
  347.                  Selects which pen to print the text in. Defaults to TEXTPEN.
  348.                  This tag overrides the GULB_TextColor tag.
  349.  
  350.               GULB_Flags (ULONG)
  351.                  Flags for text placement, text shadowing and 3D text:
  352.  
  353.                  ___1_____2_____3___
  354.                  |_____|_____|_____| A
  355.                  |_____|_____|_____| B 
  356.                  |_____|_____|_____| C
  357.                  
  358.                  Y-pos flags
  359.                  ~~~~~~~~~~~
  360.                     LB_TEXT_TOP    - Places the topmost point of the text below
  361.                                      the upper border of the box (row A)
  362.  
  363.                     LB_TEXT_MIDDLE - Places the text centered in the box, not
  364.                                      counting in the part of the text that is
  365.                                      below the font's baseline (row B)
  366.  
  367.                     LB_TEXT_BOTTOM - Places the text at the bottom of the box.
  368.                                      Any part of the text that is below the
  369.                                      baseline will be below the box (row C)
  370.  
  371.                  X-pos flags
  372.                  ~~~~~~~~~~~
  373.                     LB_TEXT_CENTER - Places the text centered on the width of
  374.                                      the box (column 2).
  375.  
  376.                     LB_TEXT_LEFT   - Places the text left adjusted in the box
  377.                                      (column 1)
  378.  
  379.                     LB_TEXT_RIGHT  - Places the text right adjusted in the box
  380.                                      (column 3)
  381.  
  382.                  Combined flags
  383.                  ~~~~~~~~~~~~~~
  384.                     LB_TEXT_TOP_CENTER    - LB_TEXT_TOP + LB_TEXT_CENTER
  385.                     LB_TEXT_TOP_LEFT      - LB_TEXT_TOP + LB_TEXT_LEFT
  386.                     LB_TEXT_TOP_RIGHT     - LB_TEXT_TOP + LB_TEXT_RIGHT
  387.  
  388.                     LB_TEXT_MIDDLE_CENTER - LB_TEXT_MIDDLE + LB_TEXT_CENTER
  389.                     LB_TEXT_MIDDLE_LEFT   - LB_TEXT_MIDDLE + LB_TEXT_LEFT
  390.                     LB_TEXT_MIDDLE_RIGHT  - LB_TEXT_MIDDLE + LB_TEXT_RIGHT
  391.  
  392.                     LB_TEXT_BOTTOM_CENTER - LB_TEXT_BOTTOM + LB_TEXT_CENTER
  393.                     LB_TEXT_BOTTOM_LEFT   - LB_TEXT_BOTTOM + LB_TEXT_LEFT
  394.                     LB_TEXT_BOTTOM_RIGHT  - LB_TEXT_BOTTOM + LB_TEXT_RIGHT
  395.  
  396.                  Default is LB_TEXT_TOP|LB_TEXT_CENTER. Combine the x and y
  397.                  position flags by OR:ing them together. Don't combine two X
  398.                  or two Y flags together.
  399.                 
  400.                  Shadow placement flags
  401.                  ~~~~~~~~~~~~~~~~~~~~~~
  402.                     LB_SHADOW_DR - Places the bevel box text shadow one pixel
  403.                                    below and to the right of the text. 
  404.  
  405.                     LB_SHADOW_UR - Places the bevel box text shadow one pixel
  406.                                    above and to the right of the text. 
  407.  
  408.                     LB_SHADOW_DL - Places the bevel box text shadow one pixel
  409.                                    below and to the left of the text. 
  410.  
  411.                     LB_SHADOW_UL - Places the bevel box text shadow one pixel
  412.                                    above and to the left of the text. 
  413.  
  414.                     LB_SUNAT_UL  - Another name for LB_SHADOW_DR
  415.                     LB_SUNAT_DL  - Another name for LB_SHADOW_UR
  416.                     LB_SUNAT_UR  - Another name for LB_SHADOW_DL
  417.                     LB_SUNAT_DR  - Another name for LB_SHADOW_UL
  418.  
  419.                  Default is LB_SHADOW_DR (LB_SUNAT_UL).
  420.  
  421.                     LB_3DTEXT    - This flag can be used in place of the tag
  422.                                    GULB_3DText, TRUE
  423.  
  424.               GULB_3DText (BOOL)
  425.                  Enables the shadow on the text. This tag must be used if
  426.                  GULB_ShadowColor or GULB_ShadowPen isn't used. Another
  427.                  way to enable 3D text is to set the flag LB_3DTEXT in the
  428.                  GULB_Flags tag.
  429.  
  430.               GULB_ShadowColor (ULONG)
  431.                  Selects which color to print the shadow text in. Defaults to
  432.                  the color of the SHADOWPEN.
  433.  
  434.               GULB_ShadowPen (ULONG)
  435.                  Selects which pen to print the shadow text in. Defaults to
  436.                  SHADOWPEN. This tag overrides the GULB_ShadowColor tag.
  437.  
  438.          Changed tags, and additions to GadTools:
  439.  
  440.          LISTVIEW_KIND
  441.  
  442.            GTLV_ShowSelected (UWORD id)
  443.  
  444.               This tag was changed, so that you don't have to create the
  445.               string gadget before all other gadgets. The difference from
  446.               this tag in GadTools, is that we now have to give the ID of
  447.               the string gadget to use to show the selected item.
  448.  
  449.               An example of a valid (and probably most useful) gadget to
  450.               use for GTLV_ShowSelected:
  451.  
  452.               ShowSelGad:
  453.                   dc.l    GU_GadgetKind,  STRING_KIND,    GU_AutoHeight,  4
  454.                   dc.l    GU_DupeWidth,   GAD_LISTVIEW,   GU_GadgetText,  NULL
  455.                   dc.l    TAG_DONE
  456.  
  457.               This gadget MUST be before the LISTVIEW gadget in the LayoutGadget
  458.               array.
  459.  
  460.               Special:
  461.  
  462.               ti_Data = -1    Creates a read-only gadget below the listview,
  463.                               same as for GTLV_ShowSelected, 0  for GadTools.
  464.  
  465.               ti_Data =  x    Gadget ID for the gadget that the selected item
  466.                               should be displayed in. Same as GadTools reaction
  467.                               on a gadget pointer in ti_Data.
  468.  
  469.               This gadget's ti_Data field will be changed during the creation
  470.               of the gadget, but will be changed back before GU_LayoutGadgets
  471.               returns.
  472.  
  473.          MX_KIND
  474.           The gng_GadgetText field in the NewGadget structure can be used
  475.           even with MX_KIND gadgets. This should have been included in
  476.           GadTools. The gadget text will always be placed ABOVE the gadget,
  477.           on the same side as the other texts for the gadget. Positions are
  478.           checked against WBPattern & SerialPrefs to get them "right". The
  479.           GU_GadgetText and GU_LocaleText tags are used to access this field.
  480.  
  481.  
  482.    Tags for all gadget kinds:
  483.  
  484.    Gadget width control:
  485.  
  486.       GU_Width (UWORD wid)
  487.          Absolute width of the gadget. Not recommended to use for other
  488.          gadgets than IMAGE_KIND, DRAWER_KIND and FILE_KIND.
  489.  
  490.       GU_DupeWidth (UWORD id)
  491.          Duplicate the width of another gadget.
  492.  
  493.       GU_AutoWidth (WORD add)
  494.          Width = length of text label + ti_Data. For CYCLE_KIND gadgets,
  495.      the gadget width will be calculated by checking the length of
  496.      all alternatives and using the one that is widest + 26 as width.
  497.  
  498.       GU_Columns (UWORD numcols)
  499.          Set the gadget width so that approximately ti_Data columns of
  500.          text will fit.
  501.  
  502.       GU_AddWidth (WORD add)
  503.          Add ti_Data to the total width calculation.
  504.  
  505.       GU_MinWidth (UWORD wid)
  506.          Make the gadget at least ti_Data pixels wide.
  507.  
  508.       GU_MaxWidth (UWORD wid)
  509.          Make the gadget at most ti_Data pixels wide.
  510.  
  511.       GU_AddWidChar (WORD chars)
  512.          Add the length of ti_Data characters to the total width calculation.
  513.  
  514.       GU_FractWidth (LONG parts)
  515.      Divide or multiply the gadget's width with ti_Data. A positive
  516.      value divides the gadget's width by the ti_Data, a negative ti_Data
  517.      multiplies the gadget's width with ti_Data.
  518.  
  519.     Gadget height control:
  520.  
  521.       GU_Height (UWORD hei)
  522.          Absolute height of the gadget. Not recommended to use for other
  523.          gadgets than IMAGE_KIND, DRAWER_KIND and FILE_KIND.
  524.         
  525.       GU_DupeHeight (UWORD id)
  526.          Duplicate the height of another gadget.
  527.  
  528.       GU_AutoHeight (WORD add)
  529.          Height = height of the gadget's font + ti_Data. This tag doesn't
  530.          work as it should with MX_KIND gadgets. Will be fixed later.
  531.          Use GU_HeightFactor or GU_Height for MX_KIND until this is fixed.
  532.  
  533.       GU_HeightFactor (UWORD numlines)
  534.          Set the gadget height to approximately ti_Data lines.
  535.  
  536.       GU_AddHeight (WORD add)
  537.          Add ti_Data to the total height calculation.
  538.  
  539.       GU_MinHeight (UWORD wid)
  540.          Make the gadget at least ti_Data pixels high.
  541.  
  542.       GU_MaxHeight (UWORD wid)
  543.          Make the gadget at most ti_Data pixels high.
  544.  
  545.       GU_AddHeiLines (WORD numlines)
  546.          Add the height of ti_Data/2 lines to the final height calculation.
  547.          The numlines argument is given in units of 1/2 lines to get
  548.          better resolution (ti_Data of 4 means that the height of 2
  549.          lines should be added).
  550.  
  551.       GU_FractHeight (LONG parts)
  552.      Divide or multiply the gadget's height with ti_Data. A positive
  553.      value divides the gadget's height by the ti_Data, a negative ti_Data
  554.      multiplies the gadget's height with ti_Data.
  555.  
  556.    Gadget top edge control:
  557.  
  558.       GU_Top, GU_TopRel and GU_AlignTop locks the top edge of the gadget, and
  559.       allows any bottom edge control tag to adjust the height, so that both
  560.       top and bottom edges will be correct.
  561.  
  562.       GU_Top (UWORD ypos)
  563.          Absolute top edge of the gadget. Not recommended to use for other
  564.          gadgets than the top-most gadgets.
  565.  
  566.       GU_TopRel (UWORD id)
  567.          Make the top edge relative to another gadgets bottom edge. This
  568.          gadget will be placed BELOW the given gadget.
  569.  
  570.       GU_AddTop (WORD add)
  571.          Add ti_Data to the final top edge calculation.
  572.  
  573.       GU_AlignTop (UWORD id)
  574.          Align the top edge of the gadget with another gadgets top edge.
  575.  
  576.       GU_AdjustTop (WORD add)
  577.          Add the height of the text font + ti_Data to the top edge.
  578.  
  579.       GU_AddTopLines (WORD numlines)
  580.          Add the height of ti_Data/2 lines to the final top edge. The
  581.          numlines argument is given in units of 1/2 lines to get better
  582.          resolution (ti_Data of 4 means that the height of 2 lines
  583.          should be added).
  584.  
  585.    Gadget bottom edge control:
  586.  
  587.       GU_Bottom, GU_BottomRel and GU_AlignBottom locks the bottom edge of the
  588.       gadget, and allows any top edge control tag to adjust the height, so that
  589.       both top and bottom edges will be correct.
  590.  
  591.       GU_Bottom (UWORD ypos)
  592.          Absolute bottom edge of the gadget. Not recommended to use for other
  593.          gadgets than the bottom-most gadgets. Should not be necessary to use
  594.          at all.
  595.  
  596.       GU_BottomRel (UWORD id)
  597.          Make the bottom edge relative to another gadgets top edge. This
  598.          gadget will be placed ABOVE the given gadget.
  599.  
  600.       GU_AddBottom (WORD add)
  601.          Add ti_Data to the final bottom edge calculation.
  602.  
  603.       GU_AlignBottom (UWORD id)
  604.          Align the bottom edge of the gadget with another gadgets bottom edge.
  605.  
  606.       GU_AdjustBottom (WORD add)
  607.          Subtract the height of the gadget's font + ti_Data from the top edge.
  608.          This will move the gadget UPWARDS (ti_Data + font height) pixels.
  609.  
  610.    Gadget left edge control:
  611.  
  612.       GU_Left, GU_LeftRel and GU_AlignLeft locks the left edge of the gadget,
  613.       and allows any right edge control tag to adjust the width, so that both
  614.       left and right edges will be correct.
  615.  
  616.       GU_Left (UWORD xpos)
  617.          Absoulute left edge of the gadget. Not recommended to use for other
  618.          gadgets than the left-most gadgets.
  619.  
  620.       GU_LeftRel (UWORD id)
  621.          Make the left edge relative to another gadgets right edge. This
  622.          gadget will be placed TO THE RIGHT of the given gadget.
  623.  
  624.       GU_AddLeft (WORD add)
  625.          Add ti_Data to the final left edge calculation.
  626.  
  627.       GU_AlignLeft (UWORD id)
  628.          Align the left edge of the gadget with another gadgets left edge.
  629.  
  630.       GU_AdjustLeft (WORD add)
  631.          Add the width of the gadget label + ti_Data to the left edge.
  632.  
  633.       GU_AddLeftChar (WORD chars)
  634.          Add the length of ti_Data characters to the left edge.
  635.  
  636.    Gadget right edge control:
  637.  
  638.       GU_Right, GU_RightRel and GU_AlignRight locks the right edge of the
  639.       gadget, and allows any left edge control tag to adjust the width, so
  640.       that both left and right edges will be correct.
  641.  
  642.       GU_Right (UWORD xpos)
  643.          Absoulute right edge of the gadget. Not recommended to use for other
  644.          gadgets than the right-most gadgets. Should not be necessary to use
  645.          at all.
  646.  
  647.       GU_RightRel (UWORD id)
  648.          Make the right edge relative to another gadgets left edge. This
  649.          gadget will be placed TO THE LEFT of the given gadget.
  650.  
  651.       GU_AddRight (WORD add)
  652.          Add ti_Data to the final right edge calculation.
  653.  
  654.       GU_AlignRight (UWORD id)
  655.          Align the right edge of the gadget with another gadgets right edge.
  656.  
  657.       GU_AdjustRight (WORD add)
  658.          Add the width of the gadget label + ti_Data to the left edge.
  659.  
  660.     Other tags:
  661.  
  662.       GU_ToggleSelect (BOOL)
  663.          Create a toggle select gadget. Works with BUTTON_KIND and IMAGE_KIND
  664.          gadgets.
  665.  
  666.       GU_Selected (BOOL)
  667.          Set the initial value of a toggle select gadget.
  668.  
  669.       GU_Hotkey (CHAR)
  670.          Hotkey that should simulate a press (release) of a gadget.
  671.  
  672.       GU_HotkeyCase (BOOL)
  673.          Make the hotkey case-sensitive. Default is not case sensitive.
  674.  
  675.       GU_LabelHotkey (BOOL)
  676.          Get the hotkey directly from the gadget's label. The hotkey can
  677.          be case-sensitive, but not for CYCLE, LISTVIEW and MX gadgets.
  678.  
  679.       GU_RawKey (BYTE)
  680.          Use a rawkey as a gadget hotkey. May not be case-sensitive.
  681.         
  682.    Tags that gives access to other fields in the NewGadget structure:
  683.  
  684.       GU_GadgetText (UBYTE *)
  685.          A pointer to the gadget's label. Will be copied directly into the
  686.          gng_GadgetText field of the NewGadget structure.
  687.  
  688.       GU_TextAttr (struct TextAttr *)
  689.          A pointer to an initialized TextAttr structure (to select the font).
  690.          Will be copied directly into the gng_TextAttr field of the NewGadget
  691.          structure.
  692.  
  693.       GU_Flags (ULONG)
  694.          Gadget flags. Currently available flags are as for GadTools, but
  695.          here is a short list of them:
  696.  
  697.          PLACETEXT_LEFT - Place the gadget label right aligned on the left
  698.                           side of the gadget.
  699.  
  700.          PLACETEXT_RIGHT - Place the gadget label left aligned on the right
  701.                            side of the gadget.
  702.  
  703.          PLACETEXT_ABOVE - Place the gadget label centered above the gadget.
  704.  
  705.          PLACETEXT_BELOW - Place the gadget label centered below the gadget.
  706.  
  707.          PLACETEXT_IN - Place the gadget label centered inside the gadget.
  708.  
  709.          NG_HIGHLABEL - Highlight the label (render it using SHINEPEN).
  710.  
  711.       GU_UserData (APTR)
  712.          Storage for your own data. Will probably be removed, since GadUtil
  713.          uses this filed for an internal structure (with some external
  714.          available fields).
  715.  
  716.       GU_LocaleText (ULONG stringid)
  717.          Get gadget label from a catalog. This allows easy localization of
  718.          all new programs.
  719.  
  720.  
  721.    RESULT
  722.     gad_info - a pointer to a private structure. You must keep this
  723.            value and pass it to GU_FreeLayoutGadgets() later on
  724.            in order to free up all resources used by your gadgets.
  725.            This pointer is also used in a lot of other functions
  726.            in this library.
  727.  
  728.    NOTES
  729.     You must be careful with the taglist in the lg_LayoutTags field.
  730.     Tags are processed sequentally in the order you give them in, and
  731.     if a tag references another gadget (eg. the GL_TopRel tag), then
  732.     processing of the current gadget halts while the referenced gadget
  733.     is processed (if it has not already been processed). Problems can
  734.     occur if this gadget refers back to the original gadget that
  735.     referenced if, if it is referring to a field that has not yet been
  736.     processed in that gadget.
  737.  
  738.         Also note that you do not have to specify any tags that do not
  739.         change from gadget to gadget. Just be sure that you know in which
  740.     order the gadgets are processed (eg. relatives etc).
  741.  
  742.     Another thing to note, is that we have tried to make the processing
  743.     of position and width / height tags as usable as possible, what I
  744.     mean with this, is that if you eg first define the left edge and
  745.     then define the right edge, the width will change. BUT, there are
  746.     special cases when this isn't true. This is because we have tried
  747.     out this and decided that this was the best way to do it.
  748.  
  749.     Here comes some examples of the special cases;
  750.  
  751.     dc.l    GU_AlignLeft, GAD_1    ; Left edge aligned with GAD_1's left.
  752.     dc.l    GU_AlignRight, GAD_2    ; This stretches the gadget, so that
  753.                     ; both the left and right edges are
  754.                     ; positioned as defined.
  755.     ; Then, if we want to move the right edge 2 pixels right, and the left
  756.     ; edge two pixels right, we might try this:
  757.  
  758.     dc.l    GU_AddLeft, -2        ; This works as we want, it moves the
  759.                     ; left edge to the right place, but it
  760.                     ; also moves the whole gadget two
  761.                     ; pixels left..
  762.  
  763.     dc.l    GU_AddRight, 2        ; <- This is a common mistake. This
  764.                     ; moves the whole gadget to the right.
  765.                     ; Ie. it is moved back to the old
  766.                     ; position, not as we wanted...
  767.  
  768.     ; But if we replace the previous line with the following;
  769.  
  770.     dc.l    GU_AddWith,4        ; This works just as we wanted it to.
  771.                     ; Now the gadget should be 4 pixels
  772.                     ; wider, two to the left and two to
  773.                     ; the right.
  774.  
  775.     The same goes for GU_AddHeight and GU_AddBottom etc.
  776.  
  777.     This is actually a feature. Sometimes you might want to move the whole
  778.     button, so we made it work this way.
  779.  
  780.  
  781.    SEE ALSO
  782.     GU_FreeLayoutGadgets(), GU_CreateGadgetA(), gadtools/CreateGadgetA()
  783.     GU_RefreshWindow(), GU_RefreshBoxes(), GU_UpdateProgress()
  784.